﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InfoPick.Lib
{
    /// <summary>
    /// CQGM241-ODF光口
    /// </summary>
    public class GMODF
    {
        //序号
        public int Id { get; set; }

        //机柜名称
        public string Name { get; set; }

        //框号
        public int? Frame { get; set; }

        //板组号
        public int? BoardNum { get; set; }

        //槽位号
        public int? SLotNum { get; set; }

        //光口号
        public int? LightNum { get; set; }

        //槽位号
        public string SLotNumStr { get; set; }

        //主备用状态
        public bool? IsPrimary { get; set; }

        //主备用状态
        public string IsPrimaryStr
        {
            get
            {
                if (IsPrimary == null)
                    return "NULL";
                if (IsPrimary == true)
                    return "主用";
                if (IsPrimary == false)
                    return "备用";
                return "未知";
            }
        }

        //端口
        public int ?Port { get; set; }

        //缺省
        public bool IsDefault
        {
            get
            {
                return Port == 63;
            }
        }

        public string PortStr
        {
            get
            {
                if (Port == null)
                    return string.Empty;
                if (IsDefault)
                    return "缺省";
                else
                    return Port.ToString();
            }
            set
            {
                if (value == "缺省")
                    Port = 63;
                else
                {
                    int tmp;
                    if (int.TryParse(value, out tmp))
                        Port = tmp;
                }
            }
        }

        //全局号
        public int ?GlobalNum { get; set; }

        //全局tid
        public int ?GlobalTid { get; set; }

        //ODF位置
        public string ODFPosition { get; set; }

        //No.7链路时隙
        public string No7Link { get; set; }


        //系统
        public int ?System { get; set; }

        //方向
        public string Direction { get; set; }

        //备注
        public string Remark { get; set; }


        //CCU模块号
        public int ?CCUNum { get; set; }

        //SPF模块号
        public int? SPFNum { get; set; }

        //扣板号
        public int? KNum { get; set; }

        //起始电路号(SC)
        public int ?SCNum { get; set; }

        //终止电路号(EC)
        public int ?ECNum { get; set; }

        //START_CIC
        public int ?StartCic { get; set; }

        //START_TID
        public int ?StartTid { get; set; }


    }
}
